﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpModelInterface.h"
#include "IEventArgs.h"
#include "UndoRedoElementsChangeEventType.h"

namespace gcmp
{
    class ElementId;

    /// \brief UndoRedo元素对象改变事件参数接口类
    ///
    /// 访问UndoRedo元素对象改变事件参数
    class GCMP_MODEL_INTERFACE_EXPORT IUndoRedoElementsChangeEventArgs :public IEventArgs
    {
        DEFINE_CAST_DERIVED(gcmp::IUndoRedoElementsChangeEventArgs, gcmp::IEventArgs);
    public:
        /// \brief 获取UndoRedo元素对象改变事件类型
        /// 
        /// \return 返回UndoRedo元素对象改变事件
        /// \see UndoRedoElementsChangeEventType.h
        virtual UndoRedoElementsChangeEventType GetType() const = 0;

        /// \brief 获取上述GetType()获得UndoRedo元素对象改变事件类型对应的元素对象Id
        ///
        /// 注意，UndoRedoElementsChangeEventType共有6种类型
        /// 其中在GetType()为PreAddition、PostDeletion时，调用该接口获得的元素对象Id，无法再在文档中获得元素对象指针(在此时机元素事实上不存在)
        /// 在PreAddition、PreUpdation、PostUpdation、PreDeletion时，可通过该接口获得的元素对象Id，再在文档中获得元素对象指针
        /// \return 返回上述GetType()获得UndoRedo元素对象改变事件类型对应的元素对象Id
        virtual const std::unordered_set<ElementId, ElementIdHash>&  GetElementIds() const = 0;
    };
}


